package com.lagou.service.impl;

import com.lagou.service.HelloService2;
import org.apache.dubbo.config.annotation.Service;
import org.apache.dubbo.rpc.RpcContext;

import java.util.Map;

@Service
public class HelloServiceImpl implements HelloService2 {

    @Override
    public String sayHello(String name, int timeToWait) {
        Map<String, String> attachments = RpcContext.getContext()
                .getAttachments();
        String ipAddress = attachments.get("ipAddress");
        System.out.println("收到：ipAddress:"+ipAddress);
        return "hello2:"+ipAddress;
    }
}
